<%--
  Created by IntelliJ IDEA.
  User: LT
  Date: 2018-11-27
  Time: 8:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <jsp:include page="${pageContext.request.contextPath}/commen/commen.jsp"></jsp:include>
</head>
<body>
<!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
<div id="main" style="margin-left: 500px; margin-top: 100px; width: 800px; height:600px;"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    $.post("/xq/queryXingqi",function(data){
        myChart.setOption({
            title: {
                text: "按星期销量统计",
                x: "center"
            },
            tooltip: {
                trigger: "item",
                formatter: "{a} <br/>{b} : {c}"
            },
            xAxis: [
                {
                    type: "category",
                    name: "x",
                    splitLine: {show: false},
                    data: data.xinqi
                }
            ],
            yAxis: [
                {
                    type: "log",
                    name: "y"
                }
            ],
            toolbox: {
                show: true,
                feature: {
                    mark: {
                        show: true
                    },
                    dataView: {
                        show: true,
                        readOnly: true
                    },
                    restore: {
                        show: true
                    },
                    saveAsImage: {
                        show: true
                    }
                }
            },
            calculable: true,
            series: [
                {
                    name: "指数",
                    type: "line",
                    data: data.xineqi

                }
            ]
        })
    })

    // 指定图表的配置项和数据


    // 使用刚指定的配置项和数据显示图表。
</script>

</body>
</html>
